package com.qingdai.business.emuns;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;

/**
 * <p>
 * 订单
 * </p>
 *
 * @author LiuZiMing
 * @since 2024-01-26
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("commodity__coupon")
@Document(indexName="coupon")
@Schema(description = "优惠卷")
public class Coupon implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    @Id
    @Schema(description = "id")
    private Integer id;

    @TableField("shop_id")
    @Field(type = FieldType.Integer)
    @Schema(description = "所属店铺id")
    private Integer shopId;

    @TableField("rule")
    @Field(type = FieldType.Text)
    @Schema(description = "规则类型")
    private String rule;

    @TableField("rule_details")
    @Field(type = FieldType.Text)
    @Schema(description = "规则细节")
    private String ruleDetail;

    @TableField("time")
    @Field(type = FieldType.Text)
    @Schema(description = "可用时间")
    private String time;

    @TableField("user_list")
    @Field(type = FieldType.Text)
    @Schema(description = "拥有优惠卷用户列表")
    private String userList;

    @TableField("enable")
    @Field(type = FieldType.Integer)
    @Schema(description = "是否用过")
    private Integer enable;
}
